package com.mashibing.tank.strategy;

import com.mashibing.tank.*;

/**
 * @description:
 * @author: 余希瑶
 * @date: 2021年06月22日 12:02
 * @version:1.0
 */
public class DefaultFireStrategy implements FireStrategy {
    @Override
    public void fire(Player p) {
        int bX = p.getX() + Player.WIDTH / 2 - Bullet.WIDTH / 2;
        int bY = p.getY() + Player.HEIGHT / 2 - Bullet.HEIGHT / 2;
        TankFrame.INSTANCE.getGm().add(new Bullet(bX, bY, p.getDir(), p.getGroup()));

        //Bullet b = new Bullet(this.id, bX, bY, this.dir, this.group, TankFrame.INSTANCE);

//        Dir[] dirs =Dir.values();
//        for(Dir d :dirs){
//
//        }
    }
}
